<template>
  <div>
    <div class="tost-box">
      <!-- <img src="../../../../../static/image/tanhao.png"> -->
      <span>有{{ eunumber }}个保单终止，请知悉</span>
      <!-- 有3个保单终止，请知悉 -->
    </div>
    <Table :columns="columns" :data="pcWorkIndexTerminateListVO.records" :loading="isLoading" style="margin-top:10px">
      <template slot-scope="{ row }" slot="payYears">
        <span>{{ row.payYear + "/" + row.payYears + row.payintv }}</span>
      </template>
      <template slot-scope="{ row }" slot="terminateDate">
        <span>{{ row.terminateDate ? row.terminateDate.slice(0, 10) : '' }}</span>
      </template>
      <template slot-scope="{ row }" slot="operate">
        <span class="table-button" @click="forward(row)">查看详情</span>
      </template>
    </Table>

    <!-- <Page :total="ipagination.total" show-sizer show-total style="text-align:right;margin-top:20px"
      @on-change="handleCurrentChange" @on-page-size-change="handleSizeChange"
      :page-size-opts="ipagination.pageSizeOptions" :current="ipagination.pageIndex" :page-size="ipagination.pageSize"
      transfer></Page> -->
  </div>
</template>

<script>
import { loadResourcesMixin } from "../../../../util/mixins/loadResourcesMixin";
import { tableChangeMixin } from "../../../../util/mixins/tableChangeMixin";
export default {
  name: "end",
  mixins: [ tableChangeMixin],
  data() {
    return {
      mixinData: {
        tableAxios: "getPCWorkIndex",
      },
      eunumber: 979,
      columns: [
        {
          title: "序号",
          type: "index",
          align: "center",
          width: 80,
        },
        {
          title: "保单号",
          key: "contNo",
          align: "center",
          width: "190",
        },
        {
          title: "投保人",
          key: "appntName",
          align: "center",
          width: "110",
        },
        {
          title: "应交日",
          key: "payToDay",
          align: "center",
          width: "130",
        },
        {
          title: "已交次数",
          slot: "payYears",
          align: "center",
          width: "100",
        },
        {
          title: "应收保费",
          key: "premium",
          align: "center",
          width: "150",
        },
        {
          title: "终止日",
          slot: "terminateDate",
          align: "center",
          width: "150",
        },
        {
          title: "保单状态",
          key: "contStateName",
          align: "center",
          width: "160",
        },
        {
          title: "保单标志",
          key: "contFlagName",
          align: "center",
          width: "160",
        },
        {
          title: "业务员",
          key: "agentName",
          align: "center",
          width: "160",
        },
        {
          title: "专员",
          key: "attacheName",
          align: "center",
          width: "160",
        },
        {
          title: "操作",
          key: "operate",
          slot: "operate",
          align: "center",
          width: "120",
          fixed: "right",
        },
      ],
      pcWorkIndexTerminateListVO: { records: [
  {
    "contNo": "713202101087617",
    "planid": "1639719065791463426",
    "workid": "1639719065808240641",
    "appntName": "张秀华",
    "payToDay": "2023-01-01",
    "payYear": "1",
    "payYears": "5",
    "payintv": "年交",
    "premium": "10000.00",
    "terminateDate": "2023-03-14 00:00:00",
    "agentName": "吕彦和",
    "agentcode": "8613000037",
    "contStateName": "退保终止",
    "contFlagName": "孤儿单",
    "reagentcode": "6130100003",
    "attacheName": "时林"
  },
  {
    "contNo": "713202101121597",
    "planid": "1639719065820823554",
    "workid": "1639719065829212162",
    "appntName": "陈忠信",
    "payToDay": "2023-01-01",
    "payYear": "1",
    "payYears": "5",
    "payintv": "年交",
    "premium": "10000.00",
    "terminateDate": "2023-02-28 00:00:00",
    "agentName": "张旭",
    "agentcode": "8613000036",
    "contStateName": "退保终止",
    "contFlagName": "在职单",
    "reagentcode": "6130100003",
    "attacheName": "时林"
  },
  {
    "contNo": "713202101225877",
    "planid": "1639719065850183681",
    "workid": "1639719065854377987",
    "appntName": "孟祥会",
    "payToDay": "2023-01-01",
    "payYear": "1",
    "payYears": "5",
    "payintv": "年交",
    "premium": "10000.00",
    "terminateDate": "2023-01-09 00:00:00",
    "agentName": "吕彦和",
    "agentcode": "8613000037",
    "contStateName": "退保终止",
    "contFlagName": "孤儿单",
    "reagentcode": "6130100003",
    "attacheName": "时林"
  },
  {
    "contNo": "713202101274037",
    "planid": "1639719065875349505",
    "workid": "1639719065883738113",
    "appntName": "姚小飞",
    "payToDay": "2023-01-01",
    "payYear": "1",
    "payYears": "20",
    "payintv": "年交",
    "premium": "3027.98",
    "terminateDate": "2023-03-21 00:00:00",
    "agentName": "吕彦和",
    "agentcode": "8613000037",
    "contStateName": "退保终止",
    "contFlagName": "孤儿单",
    "reagentcode": "6130100003",
    "attacheName": "时林"
  },
  {
    "contNo": "713202101233537",
    "planid": "1640805995333509122",
    "workid": "1640805995350286337",
    "appntName": "张菊梅",
    "payToDay": "2023-01-01",
    "payYear": "1",
    "payYears": "5",
    "payintv": "年交",
    "premium": "10000.00",
    "terminateDate": "2023-03-28 00:00:00",
    "agentName": "孙卫东",
    "agentcode": "8613000020",
    "contStateName": "退保终止",
    "contFlagName": "在职单",
    "reagentcode": "6130100003",
    "attacheName": "时林"
  },
  {
    "contNo": "713202101189867",
    "planid": "1654939162805989378",
    "workid": "1654939162818572290",
    "appntName": "李亚杰",
    "payToDay": "2023-01-01",
    "payYear": "1",
    "payYears": "5",
    "payintv": "年交",
    "premium": "30000.00",
    "terminateDate": "2023-05-06 00:00:00",
    "agentName": "陈华",
    "agentcode": "8613000031",
    "contStateName": "退保终止",
    "contFlagName": "在职单",
    "reagentcode": "6130100003",
    "attacheName": "时林"
  },
  {
    "contNo": "713202101277177",
    "planid": "1673420954953220098",
    "workid": "1673420954965803010",
    "appntName": "陈海云",
    "payToDay": "2023-01-01",
    "payYear": "1",
    "payYears": "5",
    "payintv": "年交",
    "premium": "10000.00",
    "terminateDate": "2023-06-26 00:00:00",
    "agentName": "吕彦和",
    "agentcode": "8613000037",
    "contStateName": "退保终止",
    "contFlagName": "孤儿单",
    "reagentcode": "6130100003",
    "attacheName": "时林"
  },
  {
    "contNo": "713202101295067",
    "planid": "1679581602066182145",
    "workid": "1679581602078765057",
    "appntName": "刘建英",
    "payToDay": "2023-01-01",
    "payYear": "1",
    "payYears": "5",
    "payintv": "年交",
    "premium": "10000.00",
    "terminateDate": "2023-07-13 00:00:00",
    "agentName": "黄大庆",
    "agentcode": "8613000056",
    "contStateName": "退保终止",
    "contFlagName": "在职单",
    "reagentcode": "6130100003",
    "attacheName": "时林"
  },
  {
    "contNo": "113202030000486",
    "planid": "1639719062129836034",
    "workid": "1639719062138224641",
    "appntName": "李慧",
    "payToDay": "2023-01-02",
    "payYear": "3",
    "payYears": "10",
    "payintv": "年交",
    "premium": "30219.60",
    "terminateDate": "2023-01-06 00:00:00",
    "agentName": "郝鲁平",
    "agentcode": "1130000089",
    "contStateName": "退保终止",
    "contFlagName": "孤儿单",
    "reagentcode": "6130100003",
    "attacheName": "时林"
  },
  {
    "contNo": "113202201287689",
    "planid": "1639719062180167681",
    "workid": "1639719062188556289",
    "appntName": "杨策",
    "payToDay": "2023-01-02",
    "payYear": "1",
    "payYears": "20",
    "payintv": "年交",
    "premium": "12000.00",
    "terminateDate": "2023-01-17 00:00:00",
    "agentName": "张茜",
    "agentcode": "1130000800",
    "contStateName": "退保终止",
    "contFlagName": "在职单",
    "reagentcode": "6130100003",
    "attacheName": "时林"
  }
] },
    };
  },
  created() {
    // this.form.agentSelectType = 3;
    // this.form.managerSelectType = 3;
  },
  methods: {
    // rowClassName(row, index) {
    //   if (row.disposestate == 'F') return "table-bgc";
    // },
    // 工作状态跳转
    forward(row) {
      row.contno = row.contNo || row.contno;
      row.planid = row.planId || row.planid;
      row.workid = row.workId || row.workid;
      row.agentcode = row.agentCode || row.agentcode;
      row.paytodate = row.payToDay || row.paytodate;
      row.reagentcode = row.reagentCode || row.reagentcode;
      this.$router.push({
          name: "ServiceDetail",
        query: {
          row: row,
          insuranceType: "end",
        },
      });
    },
    tableThen(res) {
      this.eunumber = res.data.eunumber;
      this.pcWorkIndexTerminateListVO = res.data.pcWorkIndexTerminateListVO;
    },
    updateIpagination(res) {
      let data = res.data.pcWorkIndexTerminateListVO;
      this.ipagination.total =
        +data.total || (data.total == 0 ? 0 : this.ipagination.total);
      this.ipagination.index = +data.current || this.ipagination.index;
      this.ipagination.pageSize = +data.size || this.ipagination.pageSize;
    },
  },
};
</script>
<style scoped>
.tost-box {
  display: flex;
  align-items: center;
  padding: 10px;
  background: #fff7ea;
  border-radius: 4px;
  color: #ee8623;
  font-size: 14px;
  margin-bottom: 10px;
}

.tost-box>img {
  width: 14px;
  height: 14px;
  margin-right: 10px;
}
</style>
